package com.zyc.mapper;

import com.zyc.pojo.SP_StatePojo;
import com.zyc.pojo.UserPojo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface SP_StateMapper {


    //根据id查询审批状态
    @Select("select * from sp_state where id=#{id}")
    @Results(id = "findSP_StateById",value = {
            @Result(id=true,column = "id",property = "id"),
            @Result(column = "state",property = "state")
    })
    SP_StatePojo findSP_StateById(Integer id);

    //查询全部审批状态
    @Select("select * from sp_state")
    @Results(id = "findAllSP_State",value = {
            @Result(id=true,column = "id",property = "id"),
            @Result(column = "state",property = "state")
    })
    List<SP_StatePojo> findAllSP_State();

    //添加审批状态
    @Insert("insert into sp_state(state) " +
            "values(#{state})")
    int insertSP_State(SP_StatePojo sp_statePojo);

}
